<?php

require_once '../../config.php';

$operators  = operators_get_online();

if (!empty($operators)) {
  $messages = messages_get(session_id());
}

?>

<?php if (!empty($operators)): foreach($messages as $m): ?>
  <div style="padding:5px;border: 1px solid #eee; border-width: 0px 0px 1px 0px">
    <?php echo $m['senderName'] . ': ' .$m['message'] ?><br />
  </div>
  
<?php endforeach; else: ?>
  No available operators
  
<?php endif ?>